let axios

const requests = {
    account: {
        list: params => axios.get('account/list', { params }),
        search: params => axios.get('account/search', { params }),
        add: data => axios.put('account', data),
        update: data => axios.post('account', data),
        delete: id => axios.delete('account/' + id),
    },
}

export function useRequests() {
    return requests
}

export default {
    install: (app, axiosInstance) => {
        axios = axiosInstance
        app.config.globalProperties.requests = requests
    }
}
